home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / fakeer1a / dlgerror.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-08-27  |  4.6 KB  |  116 lines

  1. VERSION 5.00
  2. Begin VB.Form dlgError 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "System Error"
  5.    ClientHeight    =   1695
  6.    ClientLeft      =   2760
  7.    ClientTop       =   3750
  8.    ClientWidth     =   4230
  9.    ControlBox      =   0   'False
  10.    Icon            =   "dlgError.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   1695
  15.    ScaleWidth      =   4230
  16.    ShowInTaskbar   =   0   'False
  17.    StartUpPosition =   2  'CenterScreen
  18.    Begin VB.CommandButton CancelButton 
  19.       Caption         =   "CANCEL"
  20.       Enabled         =   0   'False
  21.       Height          =   375
  22.       Left            =   2160
  23.       TabIndex        =   1
  24.       Top             =   1200
  25.       Width           =   1335
  26.    End
  27.    Begin VB.CommandButton OKButton 
  28.       Caption         =   "OK"
  29.       Height          =   375
  30.       Left            =   720
  31.       TabIndex        =   0
  32.       Top             =   1200
  33.       Width           =   1335
  34.    End
  35.    Begin VB.Label lblMessage 
  36.       Caption         =   $"dlgError.frx":030A
  37.       Height          =   855
  38.       Left            =   720
  39.       TabIndex        =   2
  40.       Top             =   120
  41.       Width           =   3375
  42.    End
  43.    Begin VB.Image Image1 
  44.       Height          =   480
  45.       Left            =   120
  46.       Picture         =   "dlgError.frx":0398
  47.       Top             =   120
  48.       Width           =   480
  49.    End
  50. Attribute VB_Name = "dlgError"
  51. Attribute VB_GlobalNameSpace = False
  52. Attribute VB_Creatable = False
  53. Attribute VB_PredeclaredId = True
  54. Attribute VB_Exposed = False
  55. ' +--------------------------------------------------------------------+
  56. ' Program Name: Error
  57. ' File Name:    error.exe
  58. ' Program Type: Standard Executable
  59. ' Version:      1.0.0
  60. ' Purpose:      All it does is throw up a dialoge box with a fake
  61. '               System error, and then requiring you to reboot.
  62. '               Make sure you use this on someone who has a sense of
  63. '               humor, because it does force a reboot.
  64. ' Comments:     The best way to use this is put it in the user's
  65. '               system folder, set the RunOnce value in the registry
  66. '               to the name and path of the program, and sit back
  67. '               watch the fun...  there is no harm done with this
  68. '               program.  The worst is the reboot.
  69. ' +--------------------------------------------------------------------+
  70. ' | Author:   Bradley Buskey                                           |
  71. ' | Email:    bbuskey@sturm.org                                        |
  72. ' | Website:  http://www.sturm.org                                     |
  73. ' +--------------------------------------------------------------------+
  74. Option Explicit
  75. ' This section checks the Windows Version for either WinNT or Win9x
  76. ' It does recognise and work on Windows 98.  I have tested the
  77. ' executable on both platforms and it runs beautifully.  We have had a
  78. ' GREAT time with this one.  Great joke...
  79. Private Sub Form_Load()
  80.     ' Always DIM the varriables
  81.     Dim lngVersion As Long
  82.     ' Get the windows version.
  83.     lngVersion = GetVersion()
  84.     ' Set up the varriable for use when closing Windows.
  85.     If ((lngVersion And &H80000000) = 0) Then
  86.         glngWhichWindows32 = mlngWindowsNT
  87.     Else
  88.         glngWhichWindows32 = mlngWindows95
  89.     End If
  90.     ' This cool little line keeps the window from showing up in the
  91.     ' task list of both Windows 9x and Windows NT.
  92.     App.TaskVisible = False
  93. End Sub
  94. ' This is the only function that actually has ANY user interaction.
  95. ' With the CANCEL button disabled, the only choice is to hit OK.  I
  96. ' am working on a way to keep it from showing up in the Task Manager
  97. ' under NT.
  98. Private Sub OKButton_Click()
  99.     'Always DIM the varriables.
  100.     Dim Msg, Style, Ttl, ReturnValue
  101.     'This sets up the message box properties
  102.     Msg = "The hard disk was unable to reinitialize because exclusive access to the drive could not be obtained.  The hard drive will reinitialize the next time you restart the system."
  103.     Style = vbOKOnly + vbCritical + vbDefaultButton2
  104.     Ttl = "System Error"
  105.         
  106.     ' This creates the message box.
  107.     MsgBox Msg, Style, Ttl
  108.     ' Lets make sure we  know what OS we are dealing with.
  109.     If glngWhichWindows32 = mlngWindowsNT Then AdjustToken
  110.     If glngWhichWindows32 = mlngWindows95 Then AdjustToken
  111.     ' Close down the computer, no questions (or responses for
  112.     ' that matter) allowed.
  113.     ExitWindowsEx EWX_REBOOT, 0
  114.     Unload Me
  115. End Sub
  116.